package ${package};

import java.util.List;

import ${class};
import ${voclass};
import org.apache.ibatis.annotations.*;

public interface ${mapper} {

    <#if save>
    void save(${class_s} ${class_ss});
    </#if>
    
    <#if update>
    void update(${class_s} ${class_ss});
    </#if>
    <#if deleteBy>
    <#list deleteby_query as q>
    
    ${q.returntype} ${q.id}(${q.javatype} ${q.name});
    </#list>
    </#if>
    <#if findBy>
    <#list findby_query as q>
    
    ${q.returntype} ${q.id}(${q.javatype} ${q.name});
    </#list>
    </#if>
    
    <#if findAll>
    List<${class_s}> findAll();
    </#if>

    <#if findCount>
    int findCount();
    </#if>

    <#if findByVo>
    List<${class_s}> findByVo(${voclass_s} vo);
    
    int findCountByVo(${voclass_s} vo);
    </#if>

    <#list middleProperties as m>
    @Delete("delete from ${m.table} where ${m.ownColumn}=${r"#{"}${m.ownVar}${r"}"}")
    void remove${m.op_s}s(${id_class} ${m.ownVar});

    @Insert("insert into ${m.table} (${m.ownColumn},${m.oppositeColumn}) values(${r"#{"}${m.ownVar}${r"}"},${r"#{"}${m.oppositeVar}${r"}"})")
    void insert${m.op_s}(@Param("${m.ownVar}") ${id_class} ${m.ownVar}, @Param("${m.oppositeVar}") ${id_class} ${m.oppositeVar});

    @Select("select ${m.oppositeColumn} from ${m.table} where ${m.ownColumn}=${r"#{"}${m.ownVar}${r"}"}")
    List<${id_class_boxed}> get${m.op_s}s(int ${m.ownVar});

    </#list>
}